package models

import (
	"os"
	"gorm.io/gorm"
)

type GlobalNotification struct {
	ID       int  `json:"id" gorm:"column:id;->"`
	Bgimg 	string  `json:"bgimg" gorm:"column:bgimg;" `
}

func (n *GlobalNotification) AfterFind(tx *gorm.DB) (err error) {
	if n.Bgimg != "" {
		n.Bgimg = os.Getenv("STATIC_RESOURCE_URL") + n.Bgimg
	}
	return
}